import CopyValue from '@/components/copyValue';
import { DataType } from '../constant';
import styles from '../index.less';

export default function ReadAccessKey({ record }: { record: DataType }) {
  return (
    <>
      <div className={styles.accessKeyBody}>
        <div className={styles.row}>
          <span className={styles.label}>AccessKey ID：</span>
          <span className={styles.value}>{record.accessKey}</span>
        </div>
        <div className={styles.row}>
          <span className={styles.label}>Access Secret：</span>
          <span className={styles.value}>{record.accessSecret}</span>
        </div>
      </div>
      <CopyValue
        clipboardText={`AccessKey ID： ${record.accessKey}\nAccessKey Secret： ${record.accessSecret}`}
        toolTipText="复制ID和密钥"
      />
    </>
  );
}
